package com.czl.module_storehouse.activity.remand.details;

import android.content.Intent;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;

import com.czl.module_base.activity.BaseActivity;
import com.czl.module_storehouse.R;
import com.czl.module_storehouse.databinding.ActivityRemandInfoBinding;
import com.czl.module_storehouse.adapter.RemandInfoAdapter;

/**
 * @author xubin
 */
public class RemandInfoActivity extends BaseActivity<ActivityRemandInfoBinding> {

    @Override
    protected ActivityRemandInfoBinding getBinding(LayoutInflater layoutInflater) {
        return ActivityRemandInfoBinding.inflate(layoutInflater);
    }

    @Override
    protected void initData(Bundle savedInstanceState) {
        Intent intent = getIntent();
        int tag = intent.getIntExtra("tag", 0);
        RemandInfoAdapter adapter = new RemandInfoAdapter(R.layout.item_remand_info, tag);
        binding.recyclerView.setAdapter(adapter);
        if (RemandInfoAdapter.TAG_BORROW == tag) {
            mToolBinding.toolbarContentTitle.setText("借用详情");
            View header = View.inflate(getContext(), R.layout.header_remand_receive, null);
            adapter.addHeaderView(header);
        } else {
            mToolBinding.toolbarContentTitle.setText("领用详情");
            View header = View.inflate(getContext(), R.layout.header_remand_borrow, null);
            adapter.addHeaderView(header);
        }
        View footer = View.inflate(getContext(), R.layout.footer_common_remark, null);
        adapter.addFooterView(footer);
    }

}
